#!/bin/bash

# Job name:
#SBATCH --job-name=dynDI
#
# Project:
#SBATCH --account=ec12
#
# Wall time limit:
#SBATCH --time=5-00:00:00
# Other parameters:
#SBATCH --mem-per-cpu=2G
#SBATCH --ntasks=6 --cpus-per-task=10 --ntasks-per-node=1

######################################################
## Setting variables and prepare runtime environment:
##----------------------------------------------------
## Recommended safety settings:
set -o errexit  # Exit the script on any error
set -o nounset  # Treat any unset variables as an error

# Loading Software modules
# Always be explicit on loading modules and setting run time environment!!!
module --quiet purge            # Restore loaded modules to the default
module load R/4.1.2-foss-2021b
module load OpenMPI/4.1.1-GCC-11.2.0
module load GCCcore/11.2.0

## --bind-to core --map-by socket:PE=${SLURM_CPUS_PER_TASK}
srun /bin/hostname | uniq
mpirun --bynode -n 1 R CMD BATCH /fp/homes01/u01/ec-maxwellk/DynamicDI/Solve_ParallelSpouseC_pso_short.R /fp/homes01/u01/ec-maxwellk/DynamicDI/Solve_ParallelSpouseC_pso_short.Rout
